---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
c:\Users\minda\Documents\AI_project\amex-project(EDA)_Plot_Picked.ipynb 셀 8 in <cell line: 1>()
----> <a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=0'>1</a> plot_time_series('S')
c:\Users\minda\Documents\AI_project\amex-project(EDA)_Plot_Picked.ipynb 셀 8 in plot_time_series(prefix, cols, display_ct)
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=18'>19</a> for c in COLS:
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=19'>20</a>
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=20'>21</a> # CONVERT DATAFRAME INTO SERIES WITH COLUMN
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=21'>22</a> tmp = df[['customer_ID','S_2',c,'target']].copy()
---> <a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=22'>23</a> tmp2 = tmp.groupby(['customer_ID','target'])[['S_2',c]].agg(list).reset_index()
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=23'>24</a> tmp3 = tmp2.loc[tmp2.target==1]
<a href='vscode-notebook-cell:/c%3A/Users/minda/Documents/AI_project/amex-project%28EDA%29_Plot_Picked.ipynb#X10sZmlsZQ%3D%3D?line=24'>25</a> tmp4 = tmp2.loc[tmp2.target==0]
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\generic.py:883, in DataFrameGroupBy.aggregate(self, func, engine, engine_kwargs, *args, **kwargs)
878 if result is None:
879
880 # grouper specific aggregations
881 if self.grouper.nkeys > 1:
882 # test_groupby_as_index_series_scalar gets here with 'not self.as_index'
--> 883 return self._python_agg_general(func, *args, **kwargs)
884 elif args or kwargs:
885 # test_pass_args_kwargs gets here (with and without as_index)
886 # can't return early
887 result = self._aggregate_frame(func, *args, **kwargs)
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\groupby.py:1490, in GroupBy._python_agg_general(self, func, *args, **kwargs)
1486 name = obj.name
1488 try:
1489 # if this function is invalid for this dtype, we will ignore it.
-> 1490 result = self.grouper.agg_series(obj, f)
1491 except TypeError:
1492 warn_dropping_nuisance_columns_deprecated(type(self), "agg")
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\ops.py:972, in BaseGrouper.agg_series(self, obj, func, preserve_dtype)
969 result = self._aggregate_series_pure_python(obj, func)
971 elif not isinstance(obj._values, np.ndarray):
--> 972 result = self._aggregate_series_pure_python(obj, func)
974 # we can preserve a little bit more aggressively with EA dtype
975 # because maybe_cast_pointwise_result will do a try/except
976 # with _from_sequence. NB we are assuming here that _from_sequence
977 # is sufficiently strict that it casts appropriately.
978 preserve_dtype = True
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\ops.py:1003, in BaseGrouper._aggregate_series_pure_python(self, obj, func)
1000 # equiv: splitter = self._get_splitter(obj, axis=0)
1001 splitter = get_splitter(obj, ids, ngroups, axis=0)
-> 1003 for i, group in enumerate(splitter):
1004 group = group.__finalize__(obj, method="groupby")
1005 res = func(group)
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\ops.py:1233, in DataSplitter.__iter__(self)
1230 starts, ends = lib.generate_slices(self.slabels, self.ngroups)
1232 for start, end in zip(starts, ends):
-> 1233 yield self._chop(sdata, slice(start, end))
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\groupby\ops.py:1246, in SeriesSplitter._chop(self, sdata, slice_obj)
1244 def _chop(self, sdata: Series, slice_obj: slice) -> Series:
1245 # fastpath equivalent to `sdata.iloc[slice_obj]`
-> 1246 mgr = sdata._mgr.get_slice(slice_obj)
1247 # __finalize__ not called here, must be applied by caller if applicable
1248 return sdata._constructor(mgr, name=sdata.name, fastpath=True)
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\internals\managers.py:1827, in SingleBlockManager.get_slice(self, slobj, axis)
1824 raise IndexError("Requested axis not found in manager")
1826 blk = self._block
-> 1827 array = blk._slice(slobj)
1828 bp = BlockPlacement(slice(0, len(array)))
1829 block = type(blk)(array, placement=bp, ndim=1)
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\internals\blocks.py:313, in Block._slice(self, slicer)
310 def _slice(self, slicer) -> ArrayLike:
311 """return a slice of my values"""
--> 313 return self.values[slicer]
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\arrays\datetimelike.py:341, in DatetimeLikeArrayMixin.__getitem__(self, key)
333 """
334 This getitem defers to the underlying array, which by-definition can
335 only handle list-likes, slices, and integer scalars
336 """
337 # Use cast as we know we will get back a DatetimeLikeArray or DTScalar,
338 # but skip evaluating the Union at runtime for performance
339 # (see https://github.com/pandas-dev/pandas/pull/44624)
340 result = cast(
--> 341 "Union[DatetimeLikeArrayT, DTScalarOrNaT]", super().__getitem__(key)
342 )
343 if lib.is_scalar(result):
344 return result
File c:\Users\minda\.conda\envs\tf20\lib\site-packages\pandas\core\arrays\_mixins.py:280, in NDArrayBackedExtensionArray.__getitem__(self, key)
277 # error: Incompatible types in assignment (expression has type "ExtensionArray",
278 # variable has type "Union[int, slice, ndarray]")
279 key = extract_array(key, extract_numpy=True) # type: ignore[assignment]
--> 280 key = check_array_indexer(self, key)
281 result = self._ndarray[key]
282 if lib.is_scalar(result):
KeyboardInterrupt: